<html>
    <head>
        <script src="../../resources/js-test.js"></script>
        <script>
        function test() {
            // Overwrite the old pasteboard with default results
            document.getElementById("text").focus();
            document.getElementById("text").select();
            document.execCommand("Copy");

            // Try to copy a password
            document.getElementById("password").focus();
            document.getElementById("password").select();
            document.execCommand("Copy");

            // Paste
            document.getElementById("text").focus();
            document.getElementById("text").select();
            document.execCommand("Paste");

            shouldBe('document.getElementById("text").value', '"[not modified]"');
        }
        </script>
    </head>
    <body onload="test()">
        <p>This test verifies that copying is disabled for password fields by attempting to
        copy from a password field and paste into a textfield. If the test
        passes, you'll see a of 'PASS' message below, and the textfield will remain unmodified.</p>
        <p>(The test is only meaningful in debug builds, since paste is disabled in release builds.)</p>
        <input type="password" id="password" value="Password Input">
        <input type="text" id="text" value="[not modified]">
        <hr>
        <p id="console"></p>
    </body>
</html>
